<template>
  <div class="designer-resourse"><PageView :pageData="Page"> </PageView></div>
</template>
<script setup>
import { getResorseList } from "@/api/designer/resourse";
/**
 * 表格数据绑定
 */
const Page = markRaw({
  addBtn: {
    label: "添加",
    type: "primary",
    icon: "icon iconfont icon-add",
    method: () => {},
  },
  form: {
    data: [
      {
        type: "Input",
        field: "name",
        label: "页面名称",
        value: "",
        placeholder: "资源名称",
        allowClear: true,
      },
    ],
    btns: [
      {
        label: "查询",
        key: "search",
        icon: "icon iconfont icon-sousuo1",
        type: "primary",
      },
    ],
  },
  table: {
    columns: [
      {
        title: "资源名称",
        dataIndex: "name",
        key: "name",
      },
      {
        title: "资源包",
        dataIndex: "package",
        key: "package",
      },
      {
        title: "操作人",
        dataIndex: "oparateMan",
        key: "oparateMan",
      },
      {
        title: "操作时间",
        dataIndex: "createTime",
        key: "createTime",
      },
      {
        title: "操作",
        width: 200,
        key: "operate",
        btns: [
          {
            label: "编辑",
            class: "table_edit-btn",
            icon: "icon iconfont icon-bianji",
            key: "edit",
            argKey: "roleId",
            method: () => {},
          },
          {
            label: "删除",
            class: "table_del-btn",
            icon: "icon iconfont icon-shanchu",
            key: "delete",
            content: "请确认是否删除？",
            argKey: "roleId",
            method: () => {},
          },
        ],
      },
    ],
    data: getResorseList,
  },
  modal: {
    title: "资源",
    width: 820,
    className: "spec-modal",
    data: [
      {
        type: "Input",
        field: "name",
        label: "资源名称：",
        value: "",
        labelWidth: "90px",
        placeholder: "资源名称",
        rules: [
          {
            required: true,
            message: "请输入资源名称",
            trigger: "blur",
          },
        ],
      },
      {
        type: "Input",
        field: "package",
        label: "资源包名称：",
        value: "",
        labelWidth: "90px",
        placeholder: "资源包名称",
        rules: [
          {
            required: true,
            message: "请输入资源包名称",
            trigger: "blur",
          },
        ],
      },
      {
        type: "Input",
        field: "version",
        label: "版本号：",
        value: "",
        labelWidth: "90px",
        placeholder: "版本号",
        rules: [
          {
            required: true,
            message: "请输入版本号",
            trigger: "blur",
          },
        ],
      },
      {
        type: "Input",
        field: "name",
        label: "仓库名称：",
        value: "",
        labelWidth: "90px",
        placeholder: "仓库名称",
        rules: [
          {
            required: true,
            message: "请输入仓库名称",
            trigger: "blur",
          },
        ],
      },
      {
        type: "Input",
        field: "title",
        label: "标题：",
        value: "",
        labelWidth: "90px",
        placeholder: "标题",
        rules: [
          {
            required: true,
            message: "请输入标题",
            trigger: "blur",
          },
        ],
      },
      {
        type: "Switch",
        field: "isComponent",
        label: "是否组件：",
        value: true,
        labelWidth: "90px",
        placeholder: "是否组件",
        rules: [
          {
            required: true,
            message: "请输入是否组件",
            trigger: "blur",
          },
        ],
      },
      {
        type: "Input",
        field: "urls",
        label: "URL地址：",
        value: "",
        labelWidth: "90px",
        placeholder: "URL地址",
        rules: [
          {
            required: true,
            message: "请输入URL地址",
            trigger: "blur",
          },
        ],
      },
    ],
  },
});
</script>
